pub fn convert_base(num_str: &str, to_base: u32) -> String {
    //将numstr从k进制转换为10进制,再转换为to_base进制
    let mut num_str = num_str.to_string();
    let mut base = 10;
    let mut num = 0;
    let mut result = String::new();

    //读取进制
    if num_str.contains('(') {
        let num_str_vec: Vec<&str> = num_str.split('(').collect();
        let new_num_str = num_str_vec[0].to_string();
        base = num_str_vec[1].trim_end_matches(')').parse().unwrap();

        num_str = new_num_str;
    }

    //转换为10进制
    for c in num_str.chars() {
        num = num * base + c.to_digit(base).unwrap();
    }

    //转换为to_base进制,大于10的数字用小写字母表示
    while num > 0 {
        let remainder = num % to_base;
        let c = if remainder < 10 {
            (b'0' + remainder as u8) as char
        } else {
            (b'a' + (remainder - 10) as u8) as char
        };
        result.insert(0, c);
        num /= to_base;
    }
    result
}
